package com.redoor.app.stake.basicdata.service.impl;

import com.redoor.app.stake.basicdata.dao.BaseMqOperationLogMapper;
import com.redoor.app.stake.basicdata.model.BaseMqOperationLog;
import com.redoor.app.stake.basicdata.service.BaseMqOperationLogService;
import com.redoornetwork.framework.mybatis.service.AbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wangjunlei on 2018-03-03 18:35:03.
 */
@Service
public class BaseMqOperationLogServiceImpl extends AbstractService<BaseMqOperationLog, String> implements BaseMqOperationLogService {

    @Autowired
    private BaseMqOperationLogMapper baseMqOperationLogMapper;

    @Override
    public int saveAll(List<BaseMqOperationLog> mqOperationLogs) {
        if(mqOperationLogs != null && mqOperationLogs.size() > 0){
            // baseHsfOperationLogMapper.insertList() 只能用自增的方式新增，当前表结构无法使用
            baseMqOperationLogMapper.batchInsert(mqOperationLogs);
            return 1;
        } else {
            return 0;
        }
    }
}
